<%@page pageEncoding="UTF-8" %>
<script language="JavaScript">
<c:if test="${empty errors}">
    <c:set var="errors" value="${param.errors}"></c:set>
</c:if>
<c:if test="${not empty errors}">
    var errMsg = '';
    <c:forEach var="error" items="${errors}">
        errMsg += '<c:out value="${error}"/><br>'
    </c:forEach>
    UI.alert('错误信息', errMsg);
    <c:remove var="errors"/>
</c:if>

<%-- Success Messages --%>
<c:if test="${not empty successMessages}">
    var infoMsg = '';
    <c:forEach var="info" items="${successMessages}">
        infoMsg += '<c:out value="${info}"/><br>'
    </c:forEach>
    UI.alert('结果信息', infoMsg);
    <c:remove var="successMessages" scope="session"/>
</c:if>
</script>